package net.mihome.app.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;

import net.mihome.app.R;
import net.mihome.app.ui.view.MifuwuBanzhengView;
import net.mihome.app.ui.view.MyViewLinster;

public class MifuwuBanzhengActivity extends BaseActivity {
	private MifuwuBanzhengView mifuwuBanzhengView;
	private ProgressBar progressImageView;
	private Button sendButton;
    private View backView;
	private EditText titleEditText;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mifuwu_banzheng_main);
		titleEditText=(EditText) findViewById(R.id.et_banzheng_sendmessage);
		sendButton=(Button) findViewById(R.id.btn_banzheng_send);
		progressImageView=(ProgressBar) findViewById(R.id.mifuwu_banzheng_center_refresh);
		mifuwuBanzhengView=(MifuwuBanzhengView) findViewById(R.id.mifuwu_banzheng_view);
        backView=findViewById(R.id.user_center_back);
        backView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
		mifuwuBanzhengView.setMyViewLinster(new MyViewLinster() {
			
			@Override
			public void onLoadComplete() {
				progressImageView.setVisibility(View.GONE);
			}
			
			@Override
			public void onBeforeLoad() {
//				progressImageView.setVisibility(View.VISIBLE);
				
			}
		});

		
		mifuwuBanzhengView.initData();
		sendButton.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				mifuwuBanzhengView.titleSearchString=titleEditText.getText().toString();
				mifuwuBanzhengView.initData();
			}
		});
	}
}
